#define _CRT_SECURE_NO_WARNINGS 1
//#include<stdio.h>
//#include<stdlib.h>
//#include<assert.h>
//int main()
//{
//	int (*p)[5], n = 1;
//	p = (int*)malloc(sizeof(int) * 3 * 5);
//	assert(p);
//	for (int i = 0; i < 3; i++)
//	{
//		for (int j = 0; j < 5; j++)
//		{
//			p[i][j]=n++;
//			printf("%d ", p[i][j]);
//		}
//	}
//	free(p);
//	return 0;
//}
#include<stdio.h>
#include<stdlib.h>
#include<assert.h>
struct SK
{
	int n;
	int arr[];
}*sl;
int main()
{
	sl = (struct SK*)malloc(sizeof(struct SK) + sizeof(int) * 10);
	assert(sl);
	for (int i = 0; i < 10; i++)
	{
		sl->arr[i] = i + 1;
	}
	struct SK* p = (struct SK*)realloc(sl, sizeof(struct SK) + 5 * sizeof(int));
	assert(p);
	sl = p;
	for (int i = 0; i < 5; i++)
	{
		printf("%d ", sl->arr[i]);
	}
	free(sl);
	int* po = (int*)calloc(5, sizeof(int));
	assert(po);
	int i = 0;
	while (po[i++] = i+1, i < 5);
	i--;
	while (printf("%d ", po[i--]), i >= 0);
	free(po);
	return 0;
}
